﻿<Controls:MetroWindow x:Class="AzureVMDashboard.UI.SettingsView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:ui="clr-namespace:AzureVMDashboard.UI"
        xmlns:model="clr-namespace:AzureVMDashboard.Model"
        xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
        DataContext="{Binding Source={StaticResource Locator}, Path=Settings}"
        WindowStyle="ToolWindow"
        ResizeMode="NoResize"
        ShowCloseButton="False"
        ShowMaxRestoreButton="False"
        ShowMinButton="False"
        WindowStartupLocation="CenterOwner"
        Title="Settings" ShowInTaskbar="False" WindowState="Normal" Height="300" Width="450">
    <Controls:MetroWindow.Resources>
        <BooleanToVisibilityConverter x:Key="BoolToVisibility" />
    </Controls:MetroWindow.Resources>
    <Grid Margin="5">
        <Grid.RowDefinitions>
            <RowDefinition Height="70"/>
            <RowDefinition Height="30"/>
            <RowDefinition Height="30"/>
            <RowDefinition Height="30"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="40"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="150" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>

        <TextBlock Grid.Column="0" Grid.Row="0" VerticalAlignment="Top">Publish Settings</TextBlock>
        <Grid Grid.Column="1" Grid.Row="0">
            <Grid.RowDefinitions>
                <RowDefinition Height="30" />
                <RowDefinition Height="30" />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="50"/>
            </Grid.ColumnDefinitions>
            <TextBox Grid.Row="1">
                <Binding Path="PublishSettingsFile" Mode="TwoWay">
                    <Binding.ValidationRules>
                        <ui:FileExistValidationRule />
                    </Binding.ValidationRules>
                </Binding>
            </TextBox>
            <Button Grid.Column="1" Grid.Row="1" Width="40" Height="25" VerticalAlignment="Center" Content="..." Command="{Binding CmdSelectPublishSettings}"/>
            <Button Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="2" Width="200" Height="25" VerticalAlignment="Top" HorizontalAlignment="Left" Content="Download Publish Settings" Command="{Binding CmdDownloadPublishSettings}"/>
        </Grid>

        <!--<TextBlock Grid.Column="0" Grid.Row="0" VerticalAlignment="Top">Azure Powershell</TextBlock>
        <StackPanel Grid.Column="1" Grid.Row="0" Orientation="Horizontal" Visibility="{Binding IsAzurePowershellInstalled, Converter={StaticResource BoolToVisibility}}">
            <Rectangle Fill="Green" Opacity="0.7" Width="20" Height="20" VerticalAlignment="Center" HorizontalAlignment="Left">
                <Rectangle.OpacityMask>
                    <VisualBrush Visual="{StaticResource appbar_os_windows_8}" Stretch="Fill" />
                </Rectangle.OpacityMask>
            </Rectangle>
            <TextBlock Margin="5,0,0,0" VerticalAlignment="Center">Installed</TextBlock>
        </StackPanel>-->

        <!--<StackPanel Grid.Column="1" Grid.Row="0" Orientation="Horizontal" Visibility="{Binding IsAzurePowershellNotInstalled, Converter={StaticResource BoolToVisibility}}">
            <Rectangle Fill="Red" Opacity="0.7" Width="20" Height="20" VerticalAlignment="Center" HorizontalAlignment="Left">
                <Rectangle.OpacityMask>
                    <VisualBrush Visual="{StaticResource appbar_os_windows_8}" Stretch="Fill" />
                </Rectangle.OpacityMask>
            </Rectangle>
            <StackPanel Orientation="Horizontal">
                <TextBlock Margin="5,0,0,0" VerticalAlignment="Center">Not installed</TextBlock>
                <TextBlock Margin="5,0,0,0" VerticalAlignment="Center">
                      <Hyperlink RequestNavigate="HandleRequestNavigate" x:Name="hl1" NavigateUri="http://go.microsoft.com/?linkid=9811175">   
                          Click here to install
             </Hyperlink>
                </TextBlock>
            </StackPanel>
        </StackPanel>-->

        <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Grid.Row="5" Grid.ColumnSpan="2">
            <Button Content="Cancel" Command="{Binding CmdCancel}" Height="40" Width="80"></Button>
            <Button Content="Save" Command="{Binding CmdSave}" Height="40" Width="80"></Button>
        </StackPanel>

    </Grid>
</Controls:MetroWindow>
